package com.example.questionnaire.mbg.service.impl;

import com.example.questionnaire.mbg.entity.Result;
import com.example.questionnaire.mbg.mapper.ResultMapper;
import com.example.questionnaire.mbg.service.IResultService;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Primary
@Service
public class ResultServiceImpl implements IResultService {
    @Resource
    private ResultMapper resultMapper;

    @Override
    public void insertResult(Result result) {
        resultMapper.insertResult(result);
    }

    @Override
    public int getCntByQidAndOid(int qid, int onum) {
        return resultMapper.getCntByQidAndOid(qid, onum);
    }

    @Override
    public List<Result> getReByQidAndOid(int qid, int onum){ return resultMapper.getReByQidAndOid(qid, onum); }

    @Override
    public List<Result> getReByAidAndQid(int aid, int qid) { return resultMapper.getReByAidAndQid(aid, qid); }

    @Override
    public  List<Result> getReByAid(int aid) { return resultMapper.getReByAid(aid); }
}
